Control apparatus for an industrial machine, a method of updating a program for controlling an industrial machine, and industrial machine system

ABSTRACT

An control apparatus for an industrial machine according to an embodiment of the present invention, comprises: a submodule including a first memory of electrically rewritable nonvolatile type to store an industrial machine control program, the submodule executing the industrial machine control program stored in the first memory to control an industrial machine; a read out drive reading out a data for rewriting the industrial machine control program from a memory module; and a main module including a second memory having a rewrite control program stored therein to rewrite the industrial machine control program, and a third memory having a general control program stored therein to control the submodule, in an ordinary mode the main module executing the general control program stored in the third memory to cause the submodule to execute the industrial machine control program and control the industrial machine, in an program rewrite mode the main module executing the rewrite control program stored in the second memory to rewrite the industrial machine control program stored in the first memory, using the data read out by the read out drive.

CROSS-REFERENCE TO RELATED APPLICATIONS

[0001] This application claims the benefit of priority under 35USC § 119to Japanese Patent Application No. 2003-88200, filed on Mar. 27, 2003,the entire contents of which are incorporated herein by reference.

BACKGROUND OF THE INVENTION

[0002] 1. Field of the Invention

[0003] The present invention relates to an control apparatus for anindustrial machine, which controls industrial machines such as diecasting machines, injection molding machines and machine tools or thelike, a method of updating a program for controlling an industrialmachine, and an industrial machine system.

[0004] 2. Background Art

[0005] The control apparatus that controls industrial machines such asdie casting machines, injection molding machines and machine tools orthe like includes a main module and submodules typically inserted into abase board, as a basic configuration. The main module manages each ofthe submodules. On the other hand, the submodules are, for example,motor control modules, counter modules or relay control modules or thelike. Each submodule controls an external device (such as a motor, acounter, or a relay or the like) connected thereto. Specifically, eachsubmodule includes an EPROM storing a program to control the externaldevices, and controls the external devices by using the program.

[0006] When updating the program in each submodule, it is necessary inthe conventional art to replace the EPROM storing the program therein.In other words, a new program created by using a special developmenttool is written into an EPROM by a ROM writer, and the EPROM is carriedto the customer and the EPROM on the submodule in a control apparatus isreplaced with the carried EPROM.

[0007] However, well experienced technicians are needed to write theprogram into the EPROM and replace the EPROMs on the submodule. Inaddition, it requires labor to write the program into the EPROMs andreplace the EPROMs on the submodule. Especially, since the configurationof submodules differs according to the kind of the control apparatus, itbecomes very difficult to manage programs in submodules for each ofcontrol apparatus. In the case where there is a version change in aprogram, the management becomes further difficult.

[0008] In order to reduce the time and labor required for programupdate, a method of updating software via a network has also beendevised (see, for example, Japanese Patent Application No. 10-198571).This method is a method that makes it possible to update software in adevice by operating an apparatus to be updated, by remote control via anetwork.

[0009] If this method were used to update the programs in thesubmodules, it would be necessary to provide network equipment on afactory having the control apparatus therein and link the controlapparatus to the network equipment. This results in an increased cost,and the user is also requested to have knowledge of the network.

BRIEF DESCRIPTION OF THE DRAWINGS

[0010]FIG. 1 is a block diagram showing a configuration of an industrialmachine system according to an embodiment of the present invention;

[0011]FIG. 2 is a diagram showing an example of a data structure used toupdate programs in a flash memory;

[0012]FIG. 3 is a flow chart showing an operation algorithm of a writecontrol program;

[0013]FIG. 4 is a diagram showing an area of a flash memory in asubmodule by dividing the area into a program area and a data area; and

[0014]FIG. 5 is a diagram showing an example of a data structure used toindependently update programs and image data respectively.

SUMMARY OF THE INVENTION

[0015] An control apparatus for an industrial machine according to anembodiment of the present invention, comprises: a submodule including afirst memory of electrically rewritable nonvolatile type to store anindustrial machine control program, the submodule executing theindustrial machine control program stored in the first memory to controlan industrial machine; a read out drive reading out a data for rewritingthe industrial machine control program from a memory module; and a mainmodule including a second memory having a rewrite control program storedtherein to rewrite the industrial machine control program, and a thirdmemory having a general control program stored therein to control thesubmodule, in an ordinary mode the main module executing the generalcontrol program stored in the third memory to cause the submodule toexecute the industrial machine control program and control theindustrial machine, in an program rewrite mode the main module executingthe rewrite control program stored in the second memory to rewrite theindustrial machine control program stored in the first memory, using thedata read out by the read out drive.

[0016] An industrial machine system according to other embodiment of thepresent invention, comprises: an industrial machine to operatepredetermined processings; a submodule including a first memory ofelectrically rewritable nonvolatile type to store an industrial machinecontrol program to control the industrial machine, the submoduleexecuting the industrial machine control program to control theindustrial machine; a read out drive reading out a data for rewritingthe industrial machine control program from a memory module; and a mainmodule including a second memory having a rewrite control program storedtherein to rewrite the industrial machine control program, and a thirdmemory having a general control program stored therein to control thesubmodule, in an ordinary mode the main module executing the generalcontrol program stored in the third memory to cause the submodule toexecute the industrial machine control program and control theindustrial machine, in an program rewrite mode the main module executingthe rewrite control program stored in the second memory to rewrite theindustrial machine control program stored in the first memory, using thedata read out by the read out drive.

[0017] A method of updating a program for controlling an industrialmachine according to other embodiment of the present invention,comprises: in an ordinary mode, a main module executes a general controlprogram stored in a first memory in the main module to cause a submoduleconnected to the same bus as the main module to execute an industrialmachine control program stored in a second memory of electricallyrewritable nonvolatile type in the submodule and control an industrialmachine, and in a program rewrite mode, the main module executes arewrite control program stored in a third memory in the main module tomake a read out drive which is connected to the same bus read out a datafor rewriting the industrial machine control program from a memorymodule, and rewrites the industrial machine control program stored inthe second memory, using the data read out by the read out drive.

DETAILED DESCRIPTION OF THE INVENTION

[0018]FIG. 1 is a block diagram showing a configuration of an industrialmachine system according to an embodiment of the present invention.

[0019] As shown in FIG. 1, one main module 1, a plurality of submodules2(1) to 2(n), and a read out drive 3 are connected to a data bus 5 fordata communication. They form a control apparatus.

[0020] The main module 1, the submodules 2(1) to 2(n), and the read outdrive 3 have connectors, which are not illustrated, and these connectorsare inserted into connectors (not illustrated) in the data bus 5. As aresult, the main module 1, the submodules 2(1) to 2(n) and the read outdrive 3 are electrically connected to the data bus 5.

[0021] The main module 1, includes a CPU 10 to implement various kindsof arithmetic operation processing. Furthermore, the main module 1includes memories of three kinds, i.e., an EPROM (Erasable ProgrammableRead Only Memory) 11, a RAM (Random Access Memory) 12, and a nonvolatileflash memory 13 on which data can be electrically rewritten (erased andadded).

[0022] A program to implement the processing of writing a program (writecontrol program or rewrite control program) described later ispreviously written in the EPROM 11.

[0023] A general control program is stored in the flash memory 13 toproperly control the whole control apparatus. The general controlprogram includes various instructions and various data, and furtherincludes attribute data such as a version number of the program. Thegeneral control program becomes the subject of rewriting in the programwrite processing.

[0024] The RAM 12 is used as a work area when the CPU 10 implementsvarious kinds of arithmetic operation processing.

[0025] An input-output driver 14 is connected to the CPU 10. Aninput-output terminal device 15 such as a keyboard or a displayapparatus is connected to the input-output driver 14. The input-outputdriver 14,for example,adjusts a difference in between the operationspeed of CPU 10 and the operation speed of the input-output terminaldevice 15, and absorbs a difference in electrical characteristics. TheCPU 10 exchanges information with the worker in a factory via theinput-output driver 14 and the input-output terminal device 15.

[0026] As the input-output terminal device 15, for example, a displayapparatus having a touch panel may also be used instead of the keyboardand the display apparatus described above.

[0027] A communication input-output driver 6 is connected to the CPU 10.The communication input-output driver 6 is connected to the data bus 5as well. The communication input-output driver 6 converts an outputsignal of the CPU 10 to a signal suitable for the data bus5, and outputsa resultant signal to the data bus 5. Furthermore, the communicationinput-output driver 6 monitors data flowing on the data bus 5, acquiresdata addressed to the main module 1 from the data bus 5, and deliversthe data to the CPU 10.

[0028] In the same way as the main module 1, the submodules 2(1) to 2(n)also include CPUs 16(1) to 16(n), RAMs 18(1) to 18(n), flash memories19(1) to 19(n), input-output drivers 20(1) to 20(n), and communicationinput-output drivers 8(1) to 8(n), respectively.

[0029] External devices 21(1) to 21(n) such as motors, counters andrelays or the like are connected to the input-output drivers 20(1) to20(n). The external devices 21(1) to 21(n) are incorporated respectivelyin industrial machines 17(1) to 17(n) such as die casting machines,machine tools or injection molding machines or the like. Here, each ofthe industrial machines 17(1) to 17(n) includes one external device.Alternatively, one industrial machine may also include a plurality ofexternal devices (such as motors, counters and relays or the like). Forexample, one industrial machine may include the external devices 21(1)to 21(n).

[0030] Programs of controlling external device 21(1) to 21(n) (externaldevice control programs or industrial machine control programs) arestored in the flash memories 19(1) to 19(n), respectively. Each of theexternal device control programs includes various instructions andvarious data, and further includes attribute data such as a versionnumber of the program.

[0031] The CPUs 16(1) to 16(n) control the external devices 21(1) to21(n), i.e., the industrial machines 17(1) to 17(n) by executing theexternal device control programs, respectively.

[0032] Programs for writing new external device control programs(individual write programs or individual rewrite programs) are stored inthe flash memories 19(1) to 19(1), respectively.

[0033] The submodules 2(1) to 2(n) respectively include moduleidentification mechanisms 22(1) to 22(n) holding ID numbers. The IDnumbers can be read out by the CPUs 16(1) to 16(n).

[0034] Specifically, a plurality of signal lines are provided in an I/Oport (not illustrated) of each of the module identification mechanisms22(1) to 22(n). Each of the signal lines is pulled up to an outputpotential of the power supply or grounded. For example, in the casewhere there are eight signal lines, ID numbers of 2⁸ (=256) kinds can beset in each of the module identification mechanisms 22(1) to 22 (n).Each of the CPUs 16(1) to 16(n) recognizes the ID number of thesubmodule, i.e., the kind of the submodule by reading potentialsrespectively of the signal lines in the I/O port.

[0035] As mentioned above, the submodules 2(1) to 2(n) include memoriesof two kinds, i.e., the RAMs 18(1) to 18(n) and the flash memories 19(1)to 19(n), respectively. However unlike the main module 1, the submodules2(1) to 2(n) do not include an EPROM from the viewpoint of costreduction.

[0036] The read out drive 3 includes a communication input-output driver9. The read out drive 3 further includes a memory card connector 25. Amemory card (memory module) 24 can be inserted into the memory cardconnector 25.

[0037] The memory card 24 is a flash memory module such as a compactflash (registered) or a “Smart Media” (registered) or the like, and itis the same as one generally used in personal computers, especially innotebook computers.

[0038] Program data to be newly installed (such as data of a generalcontrol program and external device control programs to be newlyinstalled) are previously stored in the memory card 24.

[0039] Creation of new programs is implemented by a general purposepersonal computer. The created programs are transferred to a memory cardinserted into a slot of the personal computer. This memory card isinserted into the memory card connector 25, and is read out by the readout drive 3. In this way, since the program rewriting processing isimplemented by using the general purpose memory card, a specialdevelopment tool or a special medium is not needed.

[0040]FIG. 2 is a diagram showing a data structure (file) stored in thememory card 24.

[0041] This data structure has a new general control program for themain module 1, and new external device control programs for thesubmodules 2(1) to 2(n). This data structure is formed by sequentiallyarranging, for example, 8-bit blocks from an address as a predeterminedreference. Hereafter, the data structure will be described in furtherdetail.

[0042] An ID number representing the kind of a module is stored in ahead block (first block) of the data for the main module 1 and the datafor the submodules 2(1) to 2(n). In the case of the main module, the IDnumber is, for example, “0”. In the case of submodules, the ID numbersare the ID numbers set in the above described module identificationmechanisms 22(1) to 22(n).

[0043] The number of blocks storing main body data (a program to benewly installed) is stored in a block (second block) following the firstblock. For example, in the case of the data for the submodule 2(1), thenumber of blocks storing the main body data is “m1-3” as shown in FIG.2, and consequently “m1-3” is stored in the second block.

[0044] A version number of main body data (a program to be newlyinstalled) is stored in a block (third block) following the secondblock. For example, the version number is “0” in a program createdfirst, and it is incremented each time the program is updated.

[0045] Data from the first to third blocks heretofore described arereferred to as index data as shown in FIG. 2.

[0046] Main body data (programs to be newly installed, i.e., the generalcontrol program and the external device control programs) are dividedinto a plurality of blocks and stored in blocks from a block (fourthblock) following the third block to an mx_(th) (where x=1, 2, . . . n)block.

[0047] A symbol “FEND” indicating the end of the data structure (file)is stored after the bottom block mn.

[0048] Here, a module into which the programs should be written can bearbitrarily selected from the main module 1 and the submodules 2(1) to2(n). In other words, update of a program can be implemented only indesired modules by creating the index data and the main body data foronly a desired module. For example, it is also possible to create thedata structure which includes only the index data and the main body datafor the main module and does not include those for the submodules.

[0049] Furthermore, a checksum may be stored in the end part of eachmodule data as shown in FIG. 2. The checksum is a numerical valueindicating some from bottom digit of a result obtained by adding datacontents. By including the checksum, it becomes possible to, forexample, display a “write error” when the value of the checksum in thememory card 24 is different from the value of the checksum computed onthe base of data written in the flash memory, and write the module dataagain.

[0050]FIG. 3 is a flow chart showing an operation algorithm of the writecontrol program.

[0051] The write control program is stored in the EPROM 11 in the mainmodule 1, and is read out and executed by the CPU 10 in the main module1. Here, it is supposed that programs to be written newly are thegeneral control program and the external device control programs.

[0052] First, as shown in step S10 in FIG. 3, the write control programstored in the EPROM l in the main module 1 is executed (step S10).Specifically, first, the memory card 24 storing the index data and themain body data is inserted into the connector 25 in the read out drive3. If in this state the power supply of the control apparatus is turnedon while depressing a specific key (which is provided in the main bodyof the control apparatus and which is not illustrated), a start program(not illustrated) stored in the EPROM 11 in the main module 1 isexecuted. The CPU 10 starts readout of the write control program inaccordance with the start program. In other words, the write controlprogram is executed.

[0053] At this time, the submodules 2(1) to 2(n) start preparations forwrite processing (step S11). Specifically, the CPUs 16(1) to 16(n)respectively in the submodules 2(1) to 2(n) load individual writeprograms stored in the flash memories 19(1) to 19(n) into the RAMs 18(1)to 18(n). Upon loading the individual write programs into the RAMs 18(1)to 18(n), the submodules 2(1) to 2(n) sends a preparation completionflag onto the data bus 5. Until the preparation completion flag is sentto the CPU 10, the CPU 10 in the main module 1 waits (“No” of the stepS11).

[0054] Upon receiving preparation completion flags from the submodules2(1) to 2(n) (“Yes” of the step S11), the CPU 10 reads out the IDnumbers successively from the submodules 2(1) to 2 (n) and grasps thesubmodule configuration (step S12). Specifically, the CPUs 16(1) to16(n) respectively in the submodules 2(1) to 2(n) receive an ID numberacquisition command from the CPU 10, acquire the ID numbers held in themodule identification mechanisms 22(1) to 22(n), and send out theacquired ID to the CPU 10. Upon acquiring the ID numbers, the CPU 10grasps the submodule configuration on the basis of the acquired IDnumbers.

[0055] Upon grasping the submodule configuration, the CPU 10 reads thedata in the memory card 24 from the head block (first block) (see FIG.2) (step S13).

[0056] The CPU 10 determines whether the read data is the data endsymbol “FEND” (see FIG. 2) (step S14).

[0057] If the data thus read is the data end symbol “FEND” (“Yes” of thestep S14), the CPU 10 terminates the program write processing.

[0058] On the other hand, if the read data is not the data end symbol“FEND” (“No” of the step S14), i.e., the data is an ID number (see FIG.2), the CPU 10 determines whether the ID number exists in the ID numbersacquired at the step S12 (step S15). In other words, the CPU 10determines whether a module having the same ID number as the read IDnumber exists (the step S15).

[0059] Unless the same ID number as the read ID number exists in the IDnumbers acquired at the step S12 (“No” of the step S15), the CPU 10skips over following steps S16 and S17, and proceeds to subsequent stepS18.

[0060] On the other hand, if the same ID number as the read ID numberexists in the ID numbers acquired at the step S12 (“Yes” of the stepS15), the CPU 10 reads the next block (the second block), i.e., thenumber of blocks in the body data (see FIG. 2) from the memory card 24,and stores it in the RAM 12. In addition, the CPU 10 reads a blockfollowing the second block (the third block), i.e., the version number(see FIG. 2) from the memory card 24, and compares it with the versionnumber of the program which becomes the rewriting subject (step S16).

[0061] Specifically, if the rewriting subject is the main module 1, theCPU 10 compares the version number read out from the memory card 24 withthe version number of the general control program stored in the flashmemory 13 (which is included in the general control program as describedearlier).

[0062] On the other hand, if the rewriting subject is the submodules2(1) to 2(n), the CPU 10 compares the read version number with theversion number of the external device control program in the flashmemory 19 in the submodule 2 which becomes the rewriting subject (whichis included in the external device control program as describedearlier). In other words, the CPU 10 issues a version number acquisitioncommand to each of the CPUs 16 in the submodules 2. Upon receiving theversion number acquisition command, each of the CPUs 16 acquires theversion number from the external device control program in the flashmemory 19, and sends the version number to the CPU 10. The CPU 10compares the version number read from the memory card 24 with thereceived version number.

[0063] If as a result of the comparison the version number read out fromthe memory card 24 is less than or equal to the version number of theprogram which becomes there writing subject (“No” of the step S16), theCPU 10 skips over the following step S17 and proceeds to the subsequentstep S18.

[0064] On the other hand, if as a result of the comparison, the versionnumber read from the memory card 24 is greater than the version numberof the program which becomes the subject of rewriting (i.e., if theprogram to be newly installed is the latest) (“Yes” of the step S16),the CPU 10 implements the ensuing processing.

[0065] First, if the rewriting subject is the main module 1, the CPU 10erases all the data in the flash memory 13, reads out main body data(see FIG. 2) corresponding to one unit (one module) from the memory card24, and writes the main body data thus read out into the flash memory 13(step S17). Reading the main body data corresponding to one unit is doneby reading data corresponding to the number of blocks acquired at theabove described step S16, beginning with the block (the fourth block)following the block storing the version number (see FIG. 2).

[0066] On the other hand, if the subject of rewriting is the submodules2(1) to 2(n), the CPU 10 issues a program rewriting instruction to theCPU 16 in the pertinent submodule 2 (step S17). Upon receiving thisinstruction, the CPU 16 executes the individual write program loadedinto the RAM 18 at the step S11 and implements the following processing(step S17).

[0067] In other words, first, the CPU 16 erases all the data (theexternal device control program and the individual write program) in theflash memory 19. Subsequently, the CPU 10 reads out the main body data(a new external device control program) (see FIG. 2) from the memorycard 24, and sends the main body data to the CPU 16. Or the CPU 16directly reads out the main body data from the memory card 24. The CPU16 writes the main body data into the flash memory 19. Thereafter, theCPU 16 writes back the individual write program loaded into the RAM 18into the flash memory 19. By the way, it is possible to previously storethe individual write program into the memory card 24 together with theexternal device control program, and write the individual write programinto the flash memory 19 together with the external device controlprogram.

[0068] Upon finishing writing the programs into the flash memory, theCPU 10 sets an access pointer to the memory card 24 to the head of thenext module data (the main module data or the submodule data) (see FIG.2) (step 18), and repeats the steps S13 to S17 until the data end symbol“FEND” is read (“Yes” of the step S14).

[0069] Upon reading the data end symbol “FEND” (“Yes” of the step S14),the CPU 10 finishes the write control program. If thereafter the controlapparatus is restarted, the ordinary operation mode is started. In otherwords, the CPU 10 executes the general control program newly writteninto the flash memory 13, and the CPUs 16(1) to 16(n) execute theexternal device control programs newly written into the flash memories19(1) to 19(n).

[0070] In the above described program writing processing, all the datain the flash memory 19 are erased once when writing a new externaldevice control program. Therefore, the individual write program isloaded from the flash memory 19 into the RAM 18,and executed. As analternative method, it is also possible to provide a different memorysuch as an EPROM storing the individual write program in each of thesubmodules 2(1) to 2(n) and execute the individual write program withoutloading it in the RAM 18. According to this alternative method, it isnot necessary to load the individual write program into the RAM 18 andwrite back the individual write program into the flash memory 19, andthe program write processing can be executed efficiently.

[0071] Furthermore, in the above described program write processing, allthe programs to be updated are erased and new programs are written. Asan alternative method, the programs may be updated by rewriting parts ofthe programs or adding difference programs. In this case, data forpartial rewriting or data to be added should be prepared in the memorycard 24.

[0072] As a matter of course, the above-described program writeprocessing can be executed even in the case where there are a pluralityof submodules of the same kind in one control apparatus.

[0073] By the way, in some cases, the control apparatus displays a helpview (operation view) showing how to operate the industrial machine, ona display section of the industrial machine, and gives an operationguide for the operations. In this case, data of this operation view isstored in, for example, the above described flash memory 19. Asdescribed earlier, the individual write program and the external devicecontrol program are stored in the flash memory 19. In some cases, it isdesired to update the operation view data stored in the flash memory 19or the individual write program, or both of them in such a state. Inother words, in some cases, it is desired that the individual writeprogram and the operation view data can be updated independently. Tosatisfy the demand in such cases, as appreciated from FIG. 4 showing anarbitrary submodule 2(m) (m=1, 2, 3 . . . n) among the submodules 2(1)to 2(n), the area of the flash memory 19(m) should be divided into aprogram area 19 a to store the individual write program and the externaldevice control program and a data area 19 b to store image data, and oneor both f the areas should be rewritten. A data structure to archivethis is shown in FIG. 5.

[0074] As shown in FIG. 5, in this data structure, a symbol (data kind)to identify whether the subject of rewriting is a program or image datais stored in a block subsequent to the block of the ID number. In thisexample, “p” is stored in the case of a program, and “d” is stored inthe case of image data. The CPU 10 executing the write control programreads this kind “p” or “d”. In the case of “p” (program), the CPU 10writes the main body data (program) into the program area 19 a in theflash memory 2(m). On the other hand, in the case where the data kind is“d” (image data), the CPU 10 writes the main body data (image data) intothe data area 19 b. As a result, the program and the image data can beindependently rewritten respectively.

[0075]FIGS. 4 and 5 have been described by taking a submodule as anexample. In the main module as well, however, the program and the imagedata can be independently updated respectively in the same way. Whileimage data is stored in the data area 19 b, other data such as theprogram version number or the like may be stored in the data area 19 binstead of the program area 19 a.

[0076] According to the present embodiment, a program in the main moduleor submodule is updated by rewriting the program stored in the flashmemory. As a result, the program in the main module or submodule can beupdated easily.

[0077] Furthermore, at the time of program write processing, the versionnumber of the existing program is automatically checked. Only in thecase where the new program is the latest version, this new program iswritten. Therefore, the management of the program version also becomessimple.

[0078] Furthermore, since the general purpose memory card is used as amedium to store data for update, it is not necessary to develop aspecial apparatus. For example, even if the site where the controlapparatus is disposed and a division for program development are awayfrom each other, therefore, the program and the data in the controlapparatus can be updated quickly. In other words, data for writeoperation is sent from the development division to a personal computerdisposed near the control apparatus via a network. Subsequently, thedata for write operation is transferred from the personal computer to amemory card inserted into the personal computer, and this memory card ispulled out from the personal computer and is inserted into the connectorof the control apparatus. Thereafter, various programs and data in thecontrol apparatus are updated in accordance with the present embodimentdescribed above. As a result, the work of carrying an EPROM storing newprograms or the like to the site and replacing the EPROMs is notnecessary unlike the conventional technique. Therefore, the programs anddata can be updated quickly.

[0079] A wide variety of control apparatuses can be present according todifferences of configurations of submodules. Even in that case, it ispossible to use a memory card storing update data (install data) foreach of control apparatuses collectively, in common with respect to eachcontrol apparatus (only data required for the control apparatuses isextracted on the basis of an ID number). Therefore, it is not necessaryto prepare a memory card for each of control apparatuses, and the costthere about can be reduced.

[0080] In the present embodiment heretofore described, a memory card isused as a storage medium. Besides, however, for example, a hard disk, amagnetic disk and an optical disk or the like can also be used as amemory module.

[0081] Furthermore, in the present embodiment, data in a memory card isread by inserting the memory card in the read out drive. However, thedata in the memory card may be read out via a network such as theInternet or the like.

[0082] Furthermore, in the present embodiment, the general controlprogram and the external device control program are the subject of updating. Besides,however,for example, the write control program and theindividual write program can also be updated.

[0083] In the case where it is made possible to update the write controlprogram, the write control program is previously stored not in the abovedescribed EPROM but in an EEPROM (Electrically Erasable ProgrammableRead-Only Memory) or a flash memory. And at the time of program writeprocessing, the write control program is loaded from the EEPROM or thelike into the RAM and executed, and a new write control program is readout from the memory card and is written into the EEPROM or the like.

[0084] On the other hand, in the case of update of the individual writeprogram as well, at the time of updating, in the same way, theindividual write program is loaded from the flash memory into the RAMand executed, and a new individual write program read out from thememory card is written into the flash memory.

[0085] Furthermore, in the present embodiment, programs to be writteninto each of the modules are incorporated in one file, and the programsin the modules are updated in the lump by using the file. In analternative method, a file including new programs is created for everymodule, and a module which becomes the subject of rewriting and a filecorresponding to the module can be selected by a manual mode. As aresult, only programs in the selected module are rewritten to theprograms in the selected file.

[0086] Furthermore, in the present embodiment, program rewriting is notimplemented when the version of the program to be written is older thanthe version of the program which becomes the subject of rewriting. As anoption of the write control program, however, a mode that makes itpossible to implement writing irrespective of the version of the program(for example, even if the version is old) may also be provided. Thisaims at making it possible to restore the program of the previousversion when a nonconformity or the like is found in the program of theupdated version.

1. An control apparatus for an industrial machine comprising: asubmodule including a first memory of electrically rewritablenonvolatile type to store an industrial machine control program, thesubmodule executing the industrial machine control program stored in thefirst memory to control an industrial machine; a read out drive readingout a data for rewriting the industrial machine control program from amemory module; and a main module including a second memory having arewrite control program stored therein to rewrite the industrial machinecontrol program, and a third memory having a general control programstored therein to control the submodule, in an ordinary mode the mainmodule executing the general control program stored in the third memoryto cause the submodule to execute the industrial machine control programand control the industrial machine, in an program rewrite mode the mainmodule executing the rewrite control program stored in the second memoryto rewrite the industrial machine control program stored in the firstmemory, using the data read out by the read out drive.
 2. The controlapparatus according to claim 1, wherein the read out drive reads out adata for rewriting the general control program from the memory module,and in the program rewrite mode, the main module executes the rewritecontrol program to rewrite the general control program stored in thethird memory, using the data read out by the read out drive.
 3. Thecontrol apparatus according to claim 1, wherein the read out drive readsout a data for rewriting the rewrite control program from the memorymodule, and in the program rewrite mode, the main module loads therewrite control program stored in the second memory into a RAM in themain module, and executes the rewrite control program in the RAM torewrite the rewrite control program stored in the second memory, usingthe data read out data by the read out drive.
 4. The control apparatusaccording to claim 1, wherein the submodule includes an individualrewrite program stored in the first memory to rewrite the industrialmachine control program, in the program rewrite mode, the main moduleexecutes the rewrite control program to send a rewrite instruction tothe submodule, and the submodule executes the individual rewrite programstored in the first memory to rewrite the industrial machine controlprogram, using the data read out by the read out drive.
 5. The controlapparatus according to claim 4, wherein the read out drive reads out adata for rewriting the individual rewrite program from the memorymodule, and in the program rewrite mode, the main module executes therewrite control program to rewrite the individual rewrite program, usingthe data read out by the read out drive.
 6. The control apparatusaccording to claim 1, wherein the submodule has asubmodule-identifier-holder to hold an identifier for identifyingitself, the read out drive reads out the data for rewriting theindustrial machine control program associated with the identifier, fromthe memory module, and in the program rewriting mode, the main moduleexecutes the rewrite control program to acquires the identifier from thesubmodule, and rewrites the industrial machine control program in thesubmodule having the acquired identifier, using the data associated withthe acquired identifier read out by the read out drive.
 7. The controlapparatus according to claim 1, wherein the submodule includes aversion-information-holder to hold version information of the industrialmachine control program stored in the first memory, the read out drivereads out the data for rewriting the industrial machine control programassociated with the version information, from the memory module, and inthe program rewriting mode, the main module executes the rewrite controlprogram to compares the version information held in the submodule withthe version information included in the data read out by the read outdrive, and when a result of the comparison satisfies a predeterminedcondition, the main module rewrites the industrial machine controlprogram.
 8. The control apparatus according to claim 1, wherein thefirst memory has a program area to store the industrial machine controlprogram and a data area to store display data to be displayed on adisplay section of the industrial machine, the read out drive reads oneor both of the data for rewriting the industrial machine control program(a first data) and a data for rewriting the display data (a second data)from the memory module, and in the program rewriting mode, the mainmodule executes the rewrite control program to rewrite one or both ofthe industrial machine control program in the program area and thedisplay data in the data area, using one or both of the first data andthe second data read out by the read out drive.
 9. The control apparatusaccording to claim 8, wherein the first data and the second datarespectively include index data for identification of themselves, andthe main module discriminates the first data and the second data on thebasis of the index data, and writes one or both of the first data andthe second data read out by the read out drive, into one or both of theprogram area and the data area.
 10. The control apparatus according toclaim 1, wherein the submodule, the read out drive and the main moduleare connected to the same bus.
 11. The control apparatus according toclaim 1, wherein the read out drive includes a connector into which thememory module is to be inserted.
 12. An industrial machine systemcomprising: an industrial machine to operate predetermined processings;a submodule including a first memory of electrically rewritablenonvolatile type to store an industrial machine control program tocontrol the industrial machine, the submodule executing the industrialmachine control program to control the industrial machine; a read outdrive reading out a data for rewriting the industrial machine controlprogram from a memory module; and a main module including a secondmemory having a rewrite control program stored therein to rewrite theindustrial machine control program, and a third memory having a generalcontrol program stored therein to control the submodule, in an ordinarymode the main module executing the general control program stored in thethird memory to cause the submodule to execute the industrial machinecontrol program and control the industrial machine, in an programrewrite mode the main module executing the rewrite control programstored in the second memory to rewrite the industrial machine controlprogram stored in the first memory, using the data read out by the readout drive.
 13. The industrial machine system according to claim 12,wherein the submodule includes an individual rewrite program stored inthe first memory to rewrite the industrial machine control program, inthe program rewrite mode, the main module executes the rewrite controlprogram to send a rewrite instruction to the submodule, and thesubmodule executes the individual rewrite program stored in the firstmemory to rewrite the industrial machine control program, using the dataread out by the read out drive.
 14. The industrial machine systemaccording to claim 12, wherein the submodule, the read out drive and themain module are connected to the same bus.
 15. The industrial machinesystem according to claim 14, wherein the read out drive includes aconnector into which the memory module is to be inserted.
 16. Theindustrial machine system according to claim 12, wherein the industrialmachine is a die casting machine, an injection molding machine or amachine tool.
 17. A method of updating a program for controlling anindustrial machine, comprising: in an ordinary mode, a main moduleexecutes a general control program stored in a first memory in the mainmodule to cause a submodule connected to the same bus as the main moduleto execute an industrial machine control program stored in a secondmemory of electrically rewritable nonvolatile type in the submodule andcontrol an industrial machine, and in a program rewrite mode, the mainmodule executes a rewrite control program stored in a third memory inthe main module to make a read out drive which is connected to the samebus read out a data for rewriting the industrial machine control programfrom a memory module, and rewrites the industrial machine controlprogram stored in the second memory, using the data read out by the readout drive.
 18. The method of updating a program for controlling anindustrial machine according to claim 17, wherein in the program rewritemode, the main module sends a rewrite instruction to the submodule, andthe submodule executes an individual rewrite program stored in thesecond memory in the submodule to rewrite the industrial machine controlprogram, using the data read out by the read out drive.